package com.example.film.service;

import com.example.film.entity.FilmWeekSell;
import com.example.film.mapper.FilmWeekSellMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FilmWeekSellServiceImpl implements FilmWeekSellService
{
    @Autowired
    private FilmWeekSellMapper filmWeekSellMapper;

    @Override
    public List<FilmWeekSell> findFilmWeekSell() {
        return filmWeekSellMapper.findFilmWeekSell();
    }

    @Override
    public List<FilmWeekSell> findFilmWeekSellInfo(Integer pageNum, Integer pageSize) {
        int startIndex = (pageNum - 1) * pageSize;
        return filmWeekSellMapper.findFilmWeekSellInfo(startIndex, pageSize);
    }

    @Override
    public List<FilmWeekSell> findFilmWeekSellByWeek(Integer week) {
        return filmWeekSellMapper.findFilmWeekSellByWeek(week);
    }
}
